/**
 * 
 */
package com.maxin.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import com.maxin.entity.Goodstable;

/**
 * @author: maxin
 * @description: 商品信息mapper
 */
public interface GoodstableMapper {
	@Insert("insert into goodstable(id, gname, goprice, grprice, gstore, gpicture, goodstype_id) "
			+ "values(#{id}, #{gname}, #{goprice}, #{grprice}, #{gstore}, #{gpicture}, #{goodstype_id})")
	int insert(Goodstable goodstable);
	
	@Delete("delete from goodstable where id = #{id}")
	int deleteById(long id);
	
	@Update("update goodstable "
			+ "set gname = #{gname}, goprice = #{goprice}, grprice = #{grprice}, gstore = #{gstore}, gpicture = #{gpicture}, goodstype_id = #{goodstype_id} "
			+ "where id = #{id}")
	int updateById(Goodstable goodstable);

	Goodstable selectById(long id);
	
	List<Goodstable> selectAll();
	
	List<Goodstable> selectByPage(Map<String, Object> map);
}
